home *** CD-ROM | disk | FTP | other *** search
- Program Gen3d;
-
- Uses Crt;
-
-
- Const MaxPoints=200;
- MaxLines=200;
-
- Type Point3d=Record
- X,Y,Z:Integer;
- End;
-
- Object3d=Record
- NumberPoints:Byte;
- NumberLines:Byte;
- Pt:Array[1..MaxPoints] Of Point3d;
- Ln:Array[1..MaxLines,1..2] Of Byte;
- End;
-
- Var Obj:Object3d;
- Pts:Byte;
- Lns:Byte;
- A:Byte;
- Filename:String;
- F:Text;
-
- Begin
- ClrScr;
- TextColor(Yellow);
- Writeln('«««««««««««««««««««««««««««««««««««« 3D GEN »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»');
- Writeln;
- TextColor(LightCyan);
- Writeln(' By Spellcaster');
- Writeln;
- TextColor(LightGreen);
- Writeln('Number of points in object (Max=',MaxPoints,') ?');
- TextColor(LightRed);
- Readln(Pts);
- If Pts>MaxPoints Then Exit;
- Writeln;
- TextColor(LightGreen);
- Writeln('Number of lines in object (Max=',MaxLines,') ?');
- TextColor(LightRed);
- Readln(Lns);
- If Lns>MaxLines Then Exit;
- Writeln;
- TextColor(LightGreen);
- Writeln('Type in points...');
- TextColor(LightRed);
- For A:=1 To Pts Do
- Begin
- TextColor(LightGreen);
- Writeln('Point number ',A);
- Writeln('X,Y,Z ?');
- TextColor(LightRed);
- Readln(Obj.Pt[A].X,Obj.Pt[A].Y,Obj.Pt[A].Z);
- End;
- Writeln;
- TextColor(LightGreen);
- Writeln('Type in lines...');
- TextColor(LightRed);
- For A:=1 To Lns Do
- Begin
- TextColor(LightGreen);
- Writeln('Line number ',A);
- Writeln('Point1,Point2 ?');
- TextColor(LightRed);
- Readln(Obj.Ln[A,1],Obj.Ln[A,2]);
- End;
- Writeln;
- TextColor(LightGreen);
- Write('Name of file:');
- TextColor(LightCyan);
- ReadLn(Filename);
- Writeln('Saving data...');
- Assign(F,Filename);
- ReWrite(F);
- WriteLn(F,Pts);
- WriteLn(F,Lns);
- For A:=1 To Pts Do
- Begin
- WriteLn(F,Obj.Pt[A].X);
- WriteLn(F,Obj.Pt[A].Y);
- WriteLn(F,Obj.Pt[A].Z);
- End;
- For A:=1 To Lns Do
- Begin
- WriteLn(F,Obj.Ln[A,1]);
- WriteLn(F,Obj.Ln[A,2]);
- End;
- Close(F);
- TextColor(LightGreen);
- Writeln('Done...');
- Readln;
- End.